import { ref } from "vue";
import { getSalesCategory } from "@/api/cloud";
import { SalesCategory } from "@/types/index";

export default function useSalesCategory() {
  const SalesCategoryData = ref<SalesCategory[]>([]);

  getSalesCategory().then((res) => {
    const { data } = res;
    if (data.code === 200 && data.result) {
      SalesCategoryData.value = data.result;
    }
  });

  return { SalesCategoryData };
}
